package controller;

import core.BaseServlet;
import service.DepartmentService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "DepartmentServlet", urlPatterns = "/department")
public class DepartmentServlet extends BaseServlet {

    private DepartmentService departmentService = new DepartmentService();

    /**
     * 获取所有部门
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void getAllDepartment(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        departmentService.getAllDepartment(request, response);
    }

    /**
     * 查找可以修改的部门
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void getEditDepartment(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        departmentService.getEditDepartment(request, response);
    }
}
